const {createProxyMiddleware} = require('http-proxy-middleware');
module.exports = function (app) {
    app.use('/api', createProxyMiddleware({
        // target: `http://42.248.127.65:8888`,//后台服务器地址
        target: 'http://127.0.0.1:1000',
        changeOrigin: true,
        pathRewrite: {
            '^/api': '',
        },
    }))
    /* B站 */
    // app.use("/bilibili-api" , createProxyMiddleware({
    //     // target: `http://42.248.127.65:8888`,//后台服务器地址
    //     target: 'https://api.bilibili.com',
    //     changeOrigin: true,
    //     pathRewrite: {
    //         '^/bilibili-api': '',
    //     },
    // }))
    /* 支付 */
    app.use("/pay", createProxyMiddleware({
        // target: `http://42.248.127.65:8888`,//后台服务器地址
        target: 'http://www.aliyunzf.cn',
        changeOrigin: true,
        pathRewrite: {
            '^/pay': '',
        },
    }))
};
